package com.burgeon.backend.Controller;


import com.burgeon.backend.entity.VipAttrib;
import com.burgeon.backend.service.VipTageService;
import com.burgeon.backend.stsutil.ResponseResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.Map;

@CrossOrigin
@RestController
@RequestMapping("viptags")
public class VipTagsController extends BaseController{

    @Autowired
    private VipTageService vipTageService;

    @RequestMapping("modTypeName")
    public ResponseResult<Void> ModTypeName(String id,String name,String account){

        vipTageService.ModTagsTypeName(id,name,account);
        return new ResponseResult<>(SUCCESS);
    }

    @RequestMapping("addbos")
    public ResponseResult<Void> AddTags(String tid, String name, String account){

        vipTageService.AddVipTagsBos(tid,name,account);
        return new ResponseResult<Void>(SUCCESS);
    }

    @RequestMapping("delbos")
    public ResponseResult<Void> DelTags(String id, String account){

        vipTageService.DelVipTagsBos(id,account);
        return new ResponseResult<Void>(SUCCESS);
    }

    @RequestMapping("make")
    public ResponseResult<Void> MakeTags(String[] phone, VipAttrib vipAttrib, String account){

        vipTageService.MakeVipTag(phone,vipAttrib,account);
        return new ResponseResult<Void>(SUCCESS);
    }

    @RequestMapping("getwechat")
    public ResponseResult<Map> GetTags(String account){

        Map data = vipTageService.GetVipTagsWX(account);
        return new ResponseResult<Map>(SUCCESS,data);
    }

    @RequestMapping("getbos")
    public ResponseResult<Map> getTagsBos(String account){

        HashMap data = vipTageService.GetVipTagsBos(account);
        return new ResponseResult<Map>(SUCCESS,data);
    }

    @RequestMapping("delwx")
    public ResponseResult<Void> DelTagsWx(String id,String account){

        vipTageService.DelVipTagsWX(id,account);
        return new ResponseResult<>(SUCCESS);
    }

    @RequestMapping("addwx")
    public ResponseResult<Void> AddTagsWx(String name,String account){

        vipTageService.AddVipTagsWx(name,account);
        return new ResponseResult<>(SUCCESS);
    }

}
